/**********************************************************************************************/
// dgt_DoControl.h
//
// 
// Copyright Diamant Group 2007
/**********************************************************************************************/

#ifndef dgt_DoControl_H
#define dgt_DoControl_H


#include "wx/control.h"
#include <wx/wx.h>
#include "resizec.h"



/**********************************************************************************************/
//Class for dgt_DoControl
class dgt_DoControl: public wxControl
{
	public://///////////////////////////////////////////////////////////////////////////////////
	
							dgt_DoControl(void);
							dgt_DoControl(
								wxWindow*			parent, 
								wxWindowID			id,		
								const wxPoint&		pos = wxDefaultPosition,
								const wxSize&		size = wxDefaultSize,
								long				style =  wxNO_BORDER,
								const wxValidator&	validator = wxDefaultValidator );

							~dgt_DoControl( void ); 

	public://///////////////////////////////////////////////////////////////////////////////////

virtual wxSize				DoGetBestSize() const;						//set the size of control
		void				AddText(wxString  string);					//adding text
		bool				SetEnable( );			//setting control's parameters to the some state
		bool				GetEnable( void )  { return m_enableF; }	//getting state of m_enable
		
	protected://////////////////////////////////////////////////////////////////////////////////	

		void				OnLeftDown(wxMouseEvent& event);
		void				OnMove (wxMouseEvent &event);
		void				OnLeftUp (wxMouseEvent & event);
		void				OnDClick(wxMouseEvent& event);
		void				OnContextMenu (wxContextMenuEvent &event);
		void				OnDeleteClick(wxCommandEvent &event);
		void				OnPaint(wxPaintEvent& event);
		void				OnEraseBackground(wxEraseEvent& event);
		void				OnEnter(wxMouseEvent& event);
		void				OnLeave(wxMouseEvent& event);

	private:////////////////////////////////////////////////////////////////////////////////////

		int					m_x, m_y; //coordinates where window will  move
		bool				m_enableF;//flag, if window is enable
		bool				m_dragF;//flag, if window is chosen for dragging
		wxPoint				m_Point;//gets coordinates of mouse move
		wxWindow *m_resizecanvas;
		bool				m_drag;
		bool				m_ldown;
		bool				m_enter;
		bool				m_bottom_marker;
		bool				m_top_marker;

		DECLARE_EVENT_TABLE()
};

/**********************************************************************************************/
#endif  //dgt_DoControl_H

